@echo off

if exist *.obj del /q *.obj
if exist *.exp del /q *.exp
if exist *.lib del /q *.lib
if exist *.udd del /q *.udd

echo.
echo Assembling sources . . .
ml.exe /c /coff arcl32.asm
if errorlevel 1 goto :@err
ml.exe /c /coff Main.asm
if errorlevel 1 goto :@err

echo.
echo Compiling resources . . .
rc.exe /fo Resources.res /r Resources.rc
if errorlevel 1 goto :@err

::echo.
::echo Creating type library . . .
::midl.exe /I %SystemRoot%\Wirkomatron\VC++6.0\VC98\include /win32 /tlb arcl32.tlb arcl32.idl
::if errorlevel 1 goto :@err

echo.
echo Linking objects ^& resources . . .
link.exe arcl32.obj Resources.res /def:Exports.def /dll /out:arcl32.dll /subsystem:console
if errorlevel 1 goto :@err
link.exe Main.obj /entry:main /machine:x86 /out:Main.exe /subsystem:console
if errorlevel 1 goto :@err

:@err
